/*
 *  contact.h
 *  EPPI-0.0
 *
 *  Created by Juan Carlos Garcia Orden on 17/03/11
 *
 */
 
#ifndef _contact_h_
#define _contact_h_

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include "mecsystem.h"
#include "BODIES/body.h"
//#include "COMPONENTS/pointrsurface.h"
#include "CONSTRAINTS/pointrsurface.h"
//#include "CONSTRAINTS/constraint.h"
//#include "COMPONENTS/nodersurfacedd.h"
//#include "COMPONENTS/nodersurfacebeta.h"
//#include "COMPONENTS/nodersurfacebetar.h"

class MecSystem;

using namespace std;

class Contact : public Joint
{
public:
	vector<string> vNames1;
	vector<string> vNames2;
	
//	Joint* parentJoint;
	
	/*	Data members from the base class Joint
	string name;
	int dim;	
	MecSystem* parentSystem;				
	vector<Component*> vComponents;
	vector<Component*> vLoads;
 	string outGraphFilex;
	vector<string> vPointNamesSurface;
	vector<Point*> vPPointSurface;
	ofstream localFGraph;
	 string bodyName1;
	 string bodyName2;
	 Body* PBody1;
	 Body* PBody2;
	 double cstiffness;
	 double cdamping;
	 double cfriction;
	 vector<Constraint*> vConstraints;
*/

public:
	Contact(){}
	Contact(ifstream &, string, MecSystem*);
	~Contact(){}
	
	/** Virtual functions from base */
//	void setPTPointsComp();		/** Set pointers to points in each component */
//	void setPTPointsLoad();		/** Set pointers to points in each load */
	void setPTPointsCons();		/** Set pointers to points in each constraint */
//	void setPTBodies();			/** Set pointers to the bodies, based on the list of body names */
	void setPPointSurface();	/** Set pointers to surface points in each component */
	void writeMSH(ofstream&);
	void writeVTU(ofstream&);		
	void writeOOGL(ofstream&);
//	void writeFileTemp(const double&, ofstream &);
//	void setIniPosJoint(vector<double>&);
	void createContacts();
	
	/** Local functions */
	
};

#endif
